package com.example.pattern.strategy;

/**
 * 应用
 *
 * @author FM_南风
 * @date 2024/7/3
 */
public class StrategyClient {
    public static void main(String[] args) {
       int[] data = {5, 1, 3, 6, 4, 2};

       Sorter sorter = new Sorter(new BubbleSortStrategy());
       sorter.performSort(data); // 使用冒泡排序策略

       sorter.setStrategy(new QuickSortStrategy());
       sorter.performSort(data); // 使用快速排序策略
    }
}
